<?php
require_once '../include/common.inc.php';
if (!checkAdmin()) {
    header("LOCATION:index.php");
    exit;
}
$menu_index = 3;
$page_title = 'TABLA';
$guide_message = 'Media | Promotion | Edit';

getMyParam('id');
$sql="select * from `med_promotion`  where id=$id";
$ary=$mysql->fetch($sql);


include_once('menu_list.php');
require_once PrintEot('a_header');
?>
<script language="javascript">
function checkForm()
{
	var subject=document.getElementById("subject");
	var detail=documemt.getElementById("detail");
	if(subject.value=="")
	{
		alert("Please enter the subject!");
		subject.focus();
		return false;
	}
	if(detail.value=="")
	{
		alert("Please enter the detail!");
		detail.focus();
		return false;
	}
	return true;
}
</script>
<script language="javascript" src="../css/date.js"></script>
<form action="m_promotion.php" method="post" enctype="multipart/form-data" name="form1" id="form1" encsupplier="multipart/form-data">
  <table width="95%" border="0" align="center">
    <tr>
      <td align="right"><input name="action" type="hidden" id="action" value="edit" />
      <input name="id" type="hidden" id="id" value="<?=$id?>" /></td>
    </tr>
    <tr>
      <td valign="top"><table width="75%">
        <tr>
          <td >&nbsp;</td>
          <td align="center">English</td>
          <td align="center">Danish</td>
        </tr>
        <tr>
          <td width="128" >Subject :</td>
          <td width="732"><input name="subject" type="text" class="text" id="subject" size="60"  value="<?=$ary[0]["subject"]?>"/></td>
          <td width="732"><input name="subject_d" type="text" class="text" id="subject_d" size="60"  value="<?=$ary[0]["subject_d"]?>"/></td>
        </tr>
        <tr>
          <td width="128" >Detail :</td>
          <td><textarea name="detail" cols="60" rows="20" class="text" id="detail"><?=$ary[0]["detail"]?></textarea></td>
          <td><textarea name="detail_d" cols="60" rows="20" class="text" id="detail_d"><?=$ary[0]["detail_d"]?>
          </textarea></td>
        </tr>
        <tr>
          <td width="128" > Picture:</td>
          <td colspan="2"><img src="../pictures/promotion/<?=$ary[0]["pic"]?>" />(186 x 103)<br/>
            <input name="picture" type="file"  class="text" id="picture" size="52"/>
            <label>
            <input name="delpic" type="checkbox" id="delpic" value="1">
            Delete the picture</label></td>
          </tr>
        <tr>
          <td width="128" >Publish :</td>
          <td colspan="2"><label>
            <input name="publish" type="radio" value="1" <?php if($ary[0]["publish"]==1) echo " checked";?> />
            Yes
            <input type="radio" name="publish" value="0" <?php if($ary[0]["publish"]==0) echo " checked";?>/>
            No</label></td>
          </tr>
        <tr>
          <td width="128" >Publish Date:</td>
          <td colspan="2"><input name="publishdate" class="text" type="text" id="publishdate" onFocus="CreateMonthView(this)" onBlur="DeleteMonthView(this)" readonly value="<?=$ary[0]["publishdate"]?>"/></td>
          </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input name="image" type="image" onclick="Redirect('m_promotion.php',1);return false;" src="../images/admin/bt_cancel.gif" />
                <input name="image" type="image"src="../images/admin/bt_save.gif" /></td>
          <td>&nbsp;</td>
        </tr>
      </table></td>
    </tr>
  </table>
</form>
<?php require_once PrintEot('a_footer');?>